package com.zxj.transfer.orm.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

@Mapper
public interface UserAccountFreezeMapper {

    @Insert("INSERT INTO user_account_freeze (user_id, tx_no, freeze_rmb_account, freeze_us_account) VALUES (#{userId}, #{tid}, #{freezeRmbAccount}, #{freezeUsAccount})")
    int addAccountFreeze(
            @Param("userId") Integer userId,
            @Param("tid") String tid,
            @Param("freezeRmbAccount") BigDecimal freezeRmbAccount,
            @Param("freezeUsAccount") BigDecimal freezeUsAccount
    );

    @Update("UPDATE user_account_freeze SET status = 1 WHERE (tx_no = #{tid})")
    int updateStatus(@Param("tid") String tid);
}